import { reactive } from "vue";
import type { FormRules } from "element-plus";
// import { isPhone } from "@pureadmin/utils";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
	projectName: [{ required: true, message: "项目名称为必填项", trigger: "blur" }],
	projectNo: [{ required: true, message: "项目编号为必填项", trigger: "blur" }],
	projectType: [{ required: true, message: "项目类型为必填项", trigger: "change" }],
	amount: [{ required: true, message: "合同金额为必填项", trigger: "blur" }],
	advanceRatio: [{ required: true, message: "预付金额比例为必填项", trigger: "blur" }],
	consignRatio: [{ required: true, message: "发货金额比例为必填项", trigger: "blur" }],
	checkRatio: [{ required: true, message: "验收金额比例为必填项", trigger: "blur" }],
	qualityRatio: [{ required: true, message: "质保金额比例为必填项", trigger: "blur" }],
	qualityDuration: [{ required: true, message: "质保年限为必填项", trigger: "blur" }],
	warrantyPayment: [{ required: true, message: "质保金时长为必填项", trigger: "blur" }],
	warrantyDuration: [{ required: true, message: "质保时长为必填项", trigger: "blur" }],
	rangeDate: [{ required: true, message: "合同日期为必填项", trigger: "blur" }],
	rangePlanDate: [{ required: true, message: "计划日期为必填项", trigger: "blur"}],
	effectDay: [{ required: true, message: "工作日为必填项", trigger: "blur" }],
	principalUserId: [{ required: true, message: "负责人为必填项", trigger: "change" }],
	isPrivate: [{ required: true, message: "访问控制为必填项", trigger: "change" }],
  projectId: [{ required: true, message: "所属项目为必填项", trigger: "change" }],
  taskType: [{ required: true, message: "任务类型为必填项", trigger: "change" }],
  assignedTo: [{ required: true, message: "指派用户为必填项", trigger: "change" }],
  completeRate: [{ required: true, message: "完成比例为必填项", trigger: "blur" }],
  expectHour: [{ required: true, message: "预计小时为必填项", trigger: "blur" }],
  rangeHandleDate: [{ required: true, message: "实际开始时间为必填项", trigger: "blur" }],
  noticeType: [{ required: true, message: "通知方式为必填项", trigger: "change" }],
  consignType: [{ required: true, message: "货款类型为必填项", trigger: "change" }],
});
